﻿#pragma once

#include "../MonsterObject.h"
#include "../MapObject.h"
#include "../../MirDatabase/MonsterInfo.h"
#include "../../MirEnvir/Map.h"
#include <cmath>

using namespace Server::MirDatabase;
using namespace Server::MirEnvir;
namespace S = ServerPackets;

namespace Server::MirObjects::Monsters
{
    class Yimoogi : public MonsterObject
    {
    protected:
        unsigned char AttackRange = 7;
        unsigned char PoisonAttackRange = 4;
    public:
        bool NoAttack = false, ChildSpawned = false, IsChild = false, FinalTeleport = false;
    protected:
        Yimoogi *SisterMob;
    public:
        long long SpawnTime = 0;
        int WhiteSnakeCount = 2;
        virtual ~Yimoogi()
        {
            delete SisterMob;
        }

        MapObject *getTarget() const override;
        void setTarget(MapObject *value) override;

    protected:
        Yimoogi(MonsterInfo *info);

        bool SisterMobReady();

        bool InAttackRange() override;

        bool InRangedAttackRange(int distance);

        void FindTarget() override;

        void Attack() override;

        void ProcessAI() override;

        void ProcessTarget() override;

        void SpawnSlave();

    public:
        bool TeleportRandom(int attempts, int distance, Map *temp = nullptr) override;

    protected:
        void Drop() override;
    };
}
